<template>
  <div class="playlist">
    <PlayListCard v-for="item in playlists" :key="item.id" :item="item" />
  </div>
</template>
  
<script>
import PlayListCard from "@/components/basics/search/PlayListCard.vue";
export default {
  components: {
    PlayListCard,
  },
  props: {
    keywords: String,
  },
  async created() {
    // 搜索歌单
    const res = await this.axios.get(
      `/cloudsearch?keywords=${this.keywords}&type=1000`
    );

    this.playlists = res.data.result.playlists;
  },
  data() {
    return {
      playlists: [],
    };
  },
  name: "Playlist",
  methods: {
    // 点击进入歌单详情
    toAlbumDetail(id) {
      this.$router.push({ path: "/album_detail", query: { id } });
    },
  },
};
</script>
  
  <style lang="less" scoped>
</style>